<?php

class Application_Form_NewGallery extends Zend_Form
{

    public function init()
    {
        $this->setName("newGallery");
        $this->setAttrib('enctype', 'multipart/form-data');
    	$title=new Zend_Form_Element_Text('gallery_title');
    	$title->setLabel("图集标题")
    		  ->setRequired(true)
    		  ->addFilter('StripTags')
    		  ->addFilter('StringTrim')
    		  ->addValidator('NotEmpty')
    		  ->addValidator('StringLength',false,array(0,30,'UTF-8'));

    	$url_spell=new Zend_Form_Element_Text('gallery_url_spell');
    	$url_spell->setLabel("url拼音")
    				->setRequired(true)
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,100,'UTF-8'));

    	$key_words=new Zend_Form_Element_Text('gallery_key_words');
    	$key_words->setLabel("关键词")
    				->setRequired(true)
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,50,'UTF-8'));

    	$description=new Zend_Form_Element_Text('gallery_description');
    	$description->setLabel("概要描述")
    				->setRequired(true)
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,120,'UTF-8'));
    		      
    	$text_description=new Zend_Form_Element_Textarea('text_description');
    	$text_description->setLabel("文字描述")
    	            ->setAttrib('rows', '5')
    		      ->addValidator('StringLength',false,array(0,500,'UTF-8'));

    	/*$img=new Zend_Form_Element_Textarea('gallery_img');
    	$img->setLabel("图片地址")
    			->addFilter('StripTags')
    			->addFilter('StringTrim')
    			->addValidator('StringLength',false,array(0,500,'UTF-8'));
    	$img->setAttrib("rows", 5);*/
    	$logo=new Zend_Form_Element_File('gallery_logo');
    	$logo->setLabel("图集logo")->setRequired(true);
    	
    	$img1=new Zend_Form_Element_File('img1');
    	$img1->setLabel("图片1");
    	$alt1=new Zend_Form_Element_Text('alt1');
    	$alt1->setLabel("标签1")->addFilter('StripTags')->addFilter('StringTrim');
    	$img2=new Zend_Form_Element_File('img2');
    	$img2->setLabel("图片2");
    	$alt2=new Zend_Form_Element_Text('alt2');
    	$alt2->setLabel("标签2")->addFilter('StripTags')->addFilter('StringTrim');
    	$img3=new Zend_Form_Element_File('img3');
    	$img3->setLabel("图片3");
    	$alt3=new Zend_Form_Element_Text('alt3');
    	$alt3->setLabel("标签3")->addFilter('StripTags')->addFilter('StringTrim');
    	$img4=new Zend_Form_Element_File('img4');
    	$img4->setLabel("图片4");
    	$alt4=new Zend_Form_Element_Text('alt4');
    	$alt4->setLabel("标签4")->addFilter('StripTags')->addFilter('StringTrim');
    	$img5=new Zend_Form_Element_File('img5');
    	$img5->setLabel("图片5");
    	$alt5=new Zend_Form_Element_Text('alt5');
    	$alt5->setLabel("标签5")->addFilter('StripTags')->addFilter('StringTrim');
    	$img6=new Zend_Form_Element_File('img6');
    	$img6->setLabel("图片6");
    	$alt6=new Zend_Form_Element_Text('alt6');
    	$alt6->setLabel("标签6")->addFilter('StripTags')->addFilter('StringTrim');
    	
		$buy=new Zend_Form_Element_Text('gallery_buy');
    	$buy->setLabel("购买地址")
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,300,'UTF-8'));
    	$shop=new Zend_Form_Element_Text('gallery_shop');
    	$shop->setLabel("店铺名称")
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,50,'UTF-8'));
    		      
    	$shopurl=new Zend_Form_Element_Text('gallery_shop_url');
    	$shopurl->setLabel("店铺地址")
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,300,'UTF-8'));
    	$submit=new Zend_Form_Element_Submit("提交");
    	$this->addElements(array($title,$url_spell,$key_words,$description,$text_description,$logo,$img1,$alt1,$img2,$alt2,$img3,$alt3,$img4,$alt4,$img5,$alt5,$img6,$alt6,$buy,$shop,$shopurl,$submit));

    }


}

